Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security context at pod and container level for Kanister operator #3075

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

anishbista60
Copy link
Contributor

@anishbista60 anishbista60 commented Aug 29, 2024

Change Overview

Expose securityContext on kanister-operator deployment to improve security

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test
  • 🏗️ Build

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • Run make helm-test to verify that helm chart is working fine.
  • 💚 E2E

@anishbista60
Copy link
Contributor Author

anishbista60 commented Aug 30, 2024

@pavannd1 @hairyhum could you please look at this PR ?

@julio-lopez julio-lopez changed the title Added the security context at pod and container level for Kainster operator Add security context at pod and container level for Kanister operator Sep 5, 2024
@anishbista60
Copy link
Contributor Author

@julio-lopez please test it .

@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please look into this PR sir ?

@viveksinghggits
Copy link
Contributor

viveksinghggits commented Sep 11, 2024

@viveksinghggits could you please look into this PR sir ?

Can you please add the test plan. We have a helm test written here pkg/testing/helm_test.go. Let's improve that to verify this change as well.

Also, you don't have to say sir, just Vivek is fine.

@viveksinghggits
Copy link
Contributor

@julio-lopez please test it .

Usually when someone raises a PR it's their responsibility to add proper test plan and get help to test the changes. Like suggested above, let's add some tests and we can try to merge.

@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please look into this PR sir ?

Can you please add the test plan. We have a helm test written here pkg/testing/helm_test.go. Let's improve that to verify this change as well.

Also, you don't have to say sir, just Vivek is fine.

yes sure. Thank you

@anishbista60 anishbista60 force-pushed the security-context branch 3 times, most recently from 57f61ca to 9d9ccd1 Compare September 13, 2024 06:57
@anishbista60
Copy link
Contributor Author

@viveksinghggits could you please take a look ?

helm/kanister-operator/templates/deployment.yaml Outdated Show resolved Hide resolved
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
pkg/testing/helm/helm_test.go Outdated Show resolved Hide resolved
@anishbista60
Copy link
Contributor Author

@viveksinghggits Thanks for your review. I think now it's look fine according to your recommendation.
please let me know if any changes is needed.

@anishbista60 anishbista60 force-pushed the security-context branch 2 times, most recently from 1ff8179 to 3aeb47d Compare September 22, 2024 02:23
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
helm/kanister-operator/templates/deployment.yaml Outdated Show resolved Hide resolved
helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
@anishbista60 anishbista60 force-pushed the security-context branch 2 times, most recently from f06c4b4 to d207e06 Compare September 26, 2024 11:49
@anishbista60
Copy link
Contributor Author

@viveksinghggits shall i go for removing that 2nd and 3 rd test cases ?

Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anishbista60 so where we commit/push files to github, we should have a newline at the end of the file. It's general feedback for the files in this PR. Can you please make sure that they are committed properly so that they have the new line at the end.

helm/kanister-operator/values.yaml Outdated Show resolved Hide resolved
@anishbista60 anishbista60 force-pushed the security-context branch 2 times, most recently from 5f5302a to 3b4c154 Compare September 26, 2024 13:01
@anishbista60
Copy link
Contributor Author

anishbista60 commented Sep 26, 2024

now , i think looks good . Could you please reply on above in unresolved review ?

@julio-lopez julio-lopez removed their request for review September 27, 2024 03:10
@anishbista60
Copy link
Contributor Author

Anyone here please take a look and try to get it merge.

@@ -89,3 +89,4 @@ tolerations: []
#
# node labels for pod assignment. Evaluated as template
nodeSelector: {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we not adding any new fields in values.yaml for .Values.controller.containerSecurityContext? Is it already part of the values.yaml?

Copy link
Contributor Author

@anishbista60 anishbista60 Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viveksinghggits no we are not adding . Please check this discussion

and regarding for nodeSelector . It was already there before this PR. i added the new line based on this recommendation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anishbista60 I think there was a miscommunication. I was not talking about removing entire helm field. I was talking about removing the things that you had commented out #3075 (comment) and removing the default values that you had put. We would still the new helm fields that the PR is introducing.

helm/kanister-operator/templates/_helpers.tpl Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose securityContext on kanister-operator deployment to improve security
4 participants